deltas: Update delta indexes when updating summary
authorAlexander Larsson <alexl@redhat.com>
Tue, 1 Sep 2020 10:05:36 +0000 (12:05 +0200)
committerAlexander Larsson <alexl@redhat.com>
Fri, 23 Oct 2020 10:30:08 +0000 (12:30 +0200)
commiteffde3d513de1570488ddf13dac43c6413a44c68
tree875716fe54ee78035e8505eeaa2259d803417caa
parent8e1f199dd4d035b5ff501aa37c6f1229ac3c0e61
deltas: Update delta indexes when updating summary

When we update the summary file (and its list of deltas) we also update
all delta indexes. The index format is a single `a{sv}` variant identical
to the metadata-part of the summary with (currently) only the
`ostree.static-deltas` key.

Since we expect most delta indexes to change rarely, we avoid
unnecessary writes when reindexing. New indexes are compared to
existing ones and only the changed ones are written to disk.  This
avoids unnecessary write load and mtime changes on the repo server.
src/libostree/ostree-repo-static-delta-core.c
src/libostree/ostree-repo-static-delta-private.h
src/libostree/ostree-repo.c